//C- -------------------------------------------------------------------
//C- Java DjVu (r) (v. 0.8)
//C- Copyright (c) 2004-2005 LizardTech, Inc.  All Rights Reserved.
//C- Java DjVu is protected by U.S. Pat. No.C- 6,058,214 and patents
//C- pending.
//C-
//C- This software is subject to, and may be distributed under, the
//C- GNU General Public License, Version 2. The license should have
//C- accompanied the software or you may obtain a copy of the license
//C- from the Free Software Foundation at http://www.fsf.org .
//C-
//C- The computer code originally released by LizardTech under this
//C- license and unmodified by other parties is deemed "the LIZARDTECH
//C- ORIGINAL CODE."  Subject to any third party intellectual property
//C- claims, LizardTech grants recipient a worldwide, royalty-free,
//C- non-exclusive license to make, use, sell, or otherwise dispose of
//C- the LIZARDTECH ORIGINAL CODE or of programs derived from the
//C- LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
//C- General Public License.   This grant only confers the right to
//C- infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
//C- the extent such infringement is reasonably necessary to enable
//C- recipient to make, have made, practice, sell, or otherwise dispose
//C- of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
//C- any greater extent that may be necessary to utilize further
//C- modifications or combinations.
//C-
//C- The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
//C- OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
//C- TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
//C- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
//C-
//C- In addition, as a special exception, LizardTech Inc. gives permission
//C- to link the code of this program with the proprietary Java
//C- implementation provided by Sun (or other vendors as well), and
//C- distribute linked combinations including the two. You must obey the
//C- GNU General Public License in all respects for all of the code used
//C- other than the proprietary Java implementation. If you modify this
//C- file, you may extend this exception to your version of the file, but
//C- you are not obligated to do so. If you do not wish to do so, delete
//C- this exception statement from your version.
//C- -------------------------------------------------------------------
//C- Developed by Bill C. Riemers, Foxtrot Technologies Inc. as work for
//C- hire under US copyright laws.
//C- -------------------------------------------------------------------
//
package com.lizardtech.djvu{
//import java.lang.reflect.*;


/**
 * This is a factory which stores standard encoding options.  Each class
 * implementing DjVuInterface or dirived from DjVuObject should be added
 * here.  When a DjVuInterface class creates a new Object, it will use this
 * factory.  That way even the core decoding classes may be overloaded
 * simply by setting the DjVuOptions of the top level class. Use of this
 * factor also greatly speeds up the initialization of Microsoft's
 * implementation of Java 1.1.
 *
 * @author Bill C. Riemers
 * @version $Revision: 1.19 $
 */
public class DjVuOptions
{
  //~ Static fields/initializers ---------------------------------------------

  /** The build version of this code. */
  //public static var VERSION:String="0_8_09";
  
  /** This should not be changed unless you know what you are doing. */
  public static var NOCTX_BUCKET_UPPER:Boolean= false;

  /** This should not be changed unless you know what you are doing. */
  public static var NOCTX_EXPECT:Boolean= false;

  /** This should not be changed unless you know what you are doing. */
  public static var NOCTX_ACTIVE:Boolean= false;

  /** This should not be changed unless you know what you are doing. */
  public static var NOCTX_BUCKET_ACTIVE:Boolean= false;

  /** This should not be changed unless you know what you are doing. */
  public static var BEZIERGAMMA:Boolean= false;

  /**
   * True if garbage collection should be invoked manually on a regular
   * basis.  This greatly slows down the code, but it may be neccessary
   * for a low memory device.
   */
  public static var COLLECT_GARBAGE:Boolean= false;
  
  //public static var out:PrintStream=System.out;
  //public static var err:PrintStream=System.err;

  //~ Instance fields --------------------------------------------------------

  private var classAnnoLine:Class= null;
  private var classAnnoOval:Class= null;
  private var classAnnoPoly:Class= null;
  private var classAnnoText:Class= null;
  private var classAnnoRect:Class= null;
  private var classBSInputStream:Class= null;
  private var classBookmark:Class= null;
  private var classCachedInputSteam:Class= null;
  private var classDataPool:Class= null;
  private var classDjVmDir:Class= null;
  private var classDjVuAnno:Class= null;
  private var classDjVuInfo:Class= null;
  private var classDjVuPage:Class= null;
  private var classDjVuText:Class= null;
  private var classDocument:Class= null;
  private var classGBitmap:Class= null;
  private var classGPixmap:Class= null;
  private var classIFFEnumeration:Class= null;
  private var classIWBitmap:Class= null;
  private var classIWBlock:Class= null;
  private var classIWCodec:Class= null;
  private var classIWMap:Class= null;
  private var classIWPixmap:Class= null;
  private var classJB2Decode:Class= null;
  private var classJB2Dict:Class= null;
  private var classJB2Image:Class= null;
  private var classJB2Shape:Class= null;
  private var classPalette:Class= null;
  private var classZPCodec:Class= null;

  //~ Methods ----------------------------------------------------------------

  /**
   * Set the class object to use for BSInputStream.
   * 
   * @param c the class object.
   */
  public function setBSInputStreamClass(c:Class):void{
    this.classBSInputStream = c;
  }

  /**
   * Get the class object to use for BSInputStream.
   *
   * @return BSInputStream.class or child
   */
  public function getBSInputStreamClass():Class{
    return classBSInputStream;
  }

  /**
   * Set the class object to use for Bookmark.
   * 
   * @param c the class object.
   */
  public function setBookmarkClass(c:Class):void{
    this.classBookmark = c;
  }

  /**
   * Get the class object to use for Bookmark.
   *
   * @return Bookmark.class or child
   */
  public function getBookmarkClass():Class{
    return classBookmark;
  }

  /**
   * Set the class object to use for DataPool.
   * 
   * @param c the class object.
   */
  public function setCachedInputStreamClass(c:Class):void{
    this.classCachedInputSteam = c;
  }

  /**
   * Get the class object to use for DataPool.
   *
   * @return DataPool.class or child
   */
  public function getCachedInputStreamClass():Class{
    return classCachedInputSteam;
  }

  /**
   * Set the class object to use for DataPool.
   * 
   * @param c the class object.
   */
  public function setDataPoolClass(c:Class):void{
    this.classDataPool = c;
  }

  /**
   * Get the class object to use for DataPool.
   *
   * @return DataPool.class or child
   */
  public function getDataPoolClass():Class{
    return classDataPool;
  }

  /**
   * Set the class object to use for DjVmDir.
   * 
   * @param c the class object.
   */
  public function setDjVmDirClass(c:Class):void{
    this.classDjVmDir = c;
  }

  /**
   * Get the class object to use for DjVmDir.
   *
   * @return DjVmDir.class or child
   */
  public function getDjVmDirClass():Class{
    return classDjVmDir;
  }

  /**
   * Set the class object to use for DjVuAnno.
   * 
   * @param c the class object.
   */
  public function setDjVuAnnoClass(c:Class):void{
    this.classDjVuAnno = c;
  }

  /**
   * Get the class object to use for DjVuAnno.
   *
   * @return DjVuAnno.class or child
   */
  public function getDjVuAnnoClass():Class{
    return classDjVuAnno;
  }

  /**
   * Set the class object to use for DjVuInfo.
   * 
   * @param c the class object.
   */
  public function setDjVuInfoClass(c:Class):void{
    this.classDjVuInfo = c;
  }

  /**
   * Get the class object to use for DjVuInfo.
   *
   * @return DjVuInfo or child
   */
  public function getDjVuInfoClass():Class{
    return classDjVuInfo;
  }

  /**
   * Set the class object to use for DjVuPage.
   * 
   * @param c the class object.
   */
  public function setDjVuPageClass(c:Class):void{
    this.classDjVuPage = c;
  }

  /**
   * Get the class object to use for DjVuPage.
   *
   * @return DjVuPage.class or child
   */
  public function getDjVuPageClass():Class{
    return classDjVuPage;
  }

  /**
   * Set the class object to use for DjVuText.
   * 
   * @param c the class object.
   */
  public function setDjVuTextClass(c:Class):void{
    this.classDjVuText = c;
  }

  /**
   * Get the class object to use for DjVuText.
   *
   * @return DjVuText.class or child
   */
  public function getDjVuTextClass():Class{
    return classDjVuText;
  }

  /**
   * Set the class object to use for Document
   * 
   * @param c the class object.
   */
  public function setDocumentClass(c:Class):void{
    this.classDocument = c;
  }

  /**
   * Get the class object to use for Document
   *
   * @return Document.class or child
   */
  public function getDocumentClass():Class{
    return classDocument;
  }

  /**
   * Set the class object to use for GBitmap.
   * 
   * @param c the class object.
   */
  public function setGBitmapClass(c:Class):void{
    this.classGBitmap = c;
  }

  /**
   * Get the class object to use for GBitmap.
   *
   * @return GBitmap.class or child
   */
  public function getGBitmapClass():Class{
    return classGBitmap;
  }

  /**
   * Set the class object to use for AnnoLine.
   * 
   * @param c the class object.
   */
  public function setAnnoLineClass(c:Class):void{
    this.classAnnoLine = c;
  }

  /**
   * Get the class object to use for AnnoLine.
   *
   * @return AnnoLine.class or child
   */
  public function getAnnoLineClass():Class{
    return classAnnoLine;
  }

  /**
   * Set the class object to use for AnnoOval.
   * 
   * @param c the class object.
   */
  public function setAnnoOvalClass(c:Class):void{
    this.classAnnoOval = c;
  }

  /**
   * Get the class object to use for AnnoOval.
   *
   * @return AnnoOval.class or child
   */
  public function getAnnoOvalClass():Class{
    return classAnnoOval;
  }

  /**
   * Set the class object to use for Poly.
   * 
   * @param c the class object.
   */
  public function setAnnoPolyClass(c:Class):void{
    this.classAnnoPoly = c;
  }

  /**
   * Get the class object to use for Poly.
   *
   * @return Poly.class or child
   */
  public function getAnnoPolyClass():Class{
    return classAnnoPoly;
  }

  /**
   * Set the class object to use for anno.Rect.
   * 
   * @param c the class object.
   */
  public function setAnnoRectClass(c:Class):void{
    this.classAnnoRect = c;
  }

  /**
   * Get the class object to use for AnnoRect.
   *
   * @return anno.Rect.class or child
   */
  public function getAnnoRectClass():Class{
    return classAnnoRect;
  }

  /**
   * Set the class object to use for anno.Text.
   * 
   * @param c the class object.
   */
  public function setAnnoTextClass(c:Class):void{
    this.classAnnoText = c;
  }

  /**
   * Get the class object to use for anno.Text.
   *
   * @return anno.Text.class or child
   */
  public function getAnnoTextClass():Class{
    return classAnnoText;
  }

  /**
   * Set the class object to use for GPixmap.
   * 
   * @param c the class object.
   */
  public function setGPixmapClass(c:Class):void{
    this.classGPixmap = c;
  }

  /**
   * Get the class object to use for GPixmap.
   *
   * @return GPixmap.class or child
   */
  public function getGPixmapClass():Class{
    return classGPixmap;
  }

  /**
   * Set the class object to use for IFFEnumeration.
   * 
   * @param c the class object.
   */
  public function setIFFEnumerationClass(c:Class):void{
    this.classIFFEnumeration = c;
  }

  /**
   * Get the class object to use for IFFEnumeration.
   *
   * @return IFFEnumeration.class or child
   */
  public function getIFFEnumerationClass():Class{
    return classIFFEnumeration;
  }

  /**
   * Set the class object to use for IWBitmap.
   * 
   * @param c the class object.
   */
  public function setIWBitmapClass(c:Class):void{
    this.classIWBitmap = c;
  }

  /**
   * Get the class object to use for IWBitmap.
   *
   * @return IWBitmap.class or child
   */
  public function getIWBitmapClass():Class{
    return classIWBitmap;
  }

  /**
   * Set the class object to use for IWBlock.
   * 
   * @param c the class object.
   */
  public function setIWBlockClass(c:Class):void{
    this.classIWBlock = c;
  }

  /**
   * Get the class object to use for IWBlock.
   *
   * @return IWBlock.class or child
   */
  public function getIWBlockClass():Class{
    return classIWBlock;
  }

  /**
   * Set the class object to use for IWCodec.
   * 
   * @param c the class object.
   */
  public function setIWCodecClass(c:Class):void{
    this.classIWCodec = c;
  }

  /**
   * Get the class object to use for IWCodec.
   *
   * @return IWCodec.class or child
   */
  public function getIWCodecClass():Class{
    return classIWCodec;
  }

  /**
   * Set the class object to use for IWMap.
   * 
   * @param c the class object.
   */
  public function setIWMapClass(c:Class):void{
    this.classIWMap = c;
  }

  /**
   * Get the class object to use for IWMap.
   *
   * @return IWMap.class or child
   */
  public function getIWMapClass():Class{
    return classIWMap;
  }

  /**
   * Set the class object to use for IWPixmap.
   * 
   * @param c the class object.
   */
  public function setIWPixmapClass(c:Class):void{
    this.classIWPixmap = c;
  }

  /**
   * Get the class object to use for IWPixmap.
   *
   * @return IWPixmap.class or child
   */
  public function getIWPixmapClass():Class{
    return classIWPixmap;
  }

  /**
   * Set the class object to use for JB2Decode.
   *
   * @param classJB2Decode the class object.
   */
  public function setJB2DecodeClass(classJB2Decode:Class):void{
    this.classJB2Decode = classJB2Decode;
  }

  /**
   * Get the class object to use for JB2Decode.
   *
   * @return The new instance of the JB2Decode class.
   */
  public function getJB2DecodeClass():Class{
    return classJB2Decode;
  }

  /**
   * Set the class object to use for JB2Dict.
   * 
   * @param c the class object.
   */
  public function setJB2DictClass(c:Class):void{
    this.classJB2Dict = c;
  }

  /**
   * Get the class object to use for JB2Dict.
   *
   * @return The new instance of the JB2Dict class.
   */
  public function getJB2DictClass():Class{
    return classJB2Dict;
  }

  /**
   * Set the class object to use for JB2Image.
   * 
   * @param c the class object.
   */
  public function setJB2ImageClass(c:Class):void{
    this.classJB2Image = c;
  }

  /**
   * Get the class object to use for JB2Image.
   *
   * @return The new instance of the JB2Image class.
   */
  public function getJB2ImageClass():Class{
    return classJB2Image;
  }

  /**
   * Set the class object to use for JB2Shape.
   * 
   * @param c the class object.
   */
  public function setJB2ShapeClass(c:Class):void{
    this.classJB2Shape = c;
  }

  /**
   * Get the class object to use for JB2Shape.
   *
   * @return The new instance of the JB2Shape class.
   */
  public function getJB2ShapeClass():Class{
    return classJB2Shape;
  }

  /**
   * Set the class object to use for Palette.
   * 
   * @param c the class object.
   */
  public function setPaletteClass(c:Class):void{
    this.classPalette = c;
  }

  /**
   * Get the class object to use for Palette.
   *
   * @return The new instance of the Palette class.
   */
  public function getPaletteClass():Class{
    return classPalette;
  }

  /**
   * Set the class object to use for ZPCodec.
   * 
   * @param c the class object.
   */
  public function setZPCodecClass(c:Class):void{
    this.classZPCodec = c;
  }

  /**
   * Get the class object to use for ZPCodec.
   *
   * @return The new instance of the ZPCodec class.
   */
  public function getZPCodecClass():Class{
    return classZPCodec;
  }

  /**
   * Create the an instance of the Bookmark class without loading the class
   * until runtime.
   *
   * @return The new instance of the Bookmark class.
   */
  public function createBookmark():Codec{
    return DjVuObject.create(
      this,
      getBookmarkClass(),
      "com.lizardtech.djvu.outline.Bookmark") as Codec;
  }

  /**
   * Create the an instance of the DjVuAnno class without loading the class
   * until runtime.
   *
   * @return The new instance of the DjVuAnno class.
   */
  public function createDjVuAnno():Codec{
    return DjVuObject.create(
      this,
      getDjVuAnnoClass(),
      "com.lizardtech.djvu.anno.DjVuAnno") as Codec;
  }

  /**
   * Create the an instance of the DjVuText class without loading the class
   * until runtime.
   *
   * @return The new instance of the DjVuText class.
   */
  public function createDjVuText():Codec{
    return DjVuObject.create(
      this,
      getDjVuTextClass(),
      "com.lizardtech.djvu.text.DjVuText") as Codec;
  }
}}